package com.springcloudalibaba.openfeign.controller;

import org.apache.commons.lang3.RandomUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController // @RestController注解是@Controller+@ResponseBody
public class OpenFeignController {
    /*@RequestMapping("/openFeignProviderTest") // 提供给服务消费者调用的接口
    public String openFeignProviderTest() {
        return "OpenFeignTestController#openFeignProviderTest " + RandomUtils.nextInt(0, 1000);
    }*/

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("/openFeignProviderTest")
    public String openFeignProviderTest() {
        return "OpenFeignTestController#openFeignProviderTest " + serverPort;
    }
}